package com.yuandian.management.controller;

import com.yuandian.api.management.entity.ConfPageLabelMapping;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.management.service.ConfPageLabelMappingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 页签映射关系表-Controller
 * @author zfsn
 * @date 2023-7-28
 */
@Api(tags = "页签映射关系表功能接口")
@RestController
@RequestMapping("/pageLabelMappings")
public class ConfPageLabelMappingController {

    @Autowired
    private ConfPageLabelMappingService service;

	@ApiOperation(value = "查询页签映射关系全部数据", notes = "查询页签映射关系全部数据")
	@GetMapping
	public R<List<ConfPageLabelMapping>> getAllPageLabelMapping() {
		return R.ok(service.list());
	}

	@ApiOperation(value = "根据pageLabelId和menuId查出页签映射关系数据", notes = "根据pageLabelId和menuId查出页签映射关系数据(pageLabelId默认为2,menuId默认为0000)")
	@GetMapping("/pageLabelMapping")
	public R<ConfPageLabelMapping> getFixPageLabelMapping(@RequestParam(value = "pageLabelId", required = false, defaultValue = "2") String pageLabelId,
														  @RequestParam(value = "menuId", required = false, defaultValue = "0000") String menuId) {
		return R.ok(service.getConfPageLabelMapping(pageLabelId, menuId));
	}


}